<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>蜗牛拍卖个人中心</title>


</head>
<body>

		<div id="ids" style="width: 400px;height: 200px;margin-top: 50px;margin-left: 400px;">
			<form action="#">
	            <label for="addr-show">
	                <input type="text" value="" id="addr-show" hidden="hidden">
	            </label>
	            <br/>
	                               收货人:<input type="text" id="accept"  style="height:50px;"><p></p>
	                               手机号:<input type="text" id="telphone"  style="height:50px;"><p></p>
	            <!--省份选择-->
	            <select id="prov" onchange="showCity(this)" style="width:170px;height:50px;; margin-left: 55px;">
	                <option>=请选择省份=</option>
	            </select><p></p>
	            <!--城市选择-->
	            <select id="city" onchange="showCountry(this)" style="width:170px;height:50px;; margin-left: 55px;">
	                <option>=请选择城市=</option>
	            </select>
	            <p></p>
	            <!--县区选择-->
	            <select id="country" onchange="selecCountry(this)" style="width:170px;height:50px; margin-left: 55px;">
	                <option>=请选择县区=</option>
	            </select>
	           <p></p>
	            <input type="text" placeholder="详细地址" id="detail" style="margin-left: 55px;height:50px;"><p></p>
	            <button type="button" class="btn met1" onclick="add()" id="btn" style=" margin-left: 70px;width: 100px;height: 40px;">确定</button>
	        </form>
		</div>
<script type="text/javascript" src="js/address.js"></script>
<script type="text/javascript" src="js/city.js"></script>
<script type="text/javascript" src="js/city02.js"></script>
<script type="text/javascript" src="js/method01.js"></script>
<script type="text/javascript" src="js/popper.min.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/main.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>


<script type="text/javascript">
function add(){
	
	//收货人
	var accept = $("#accept").val();
	//手机
	var telphone = $("#telphone").val();
	//省份
	var province = detail_address.name;
	//城市
	var city = detail_address.city;
	//区县
	var county = detail_address.area;
	//获取详细地址
	var detailed = $("#detail").val();
	
	//1.先发送请求到后台插入一条收货地址
	$.ajax({
		url:"address/add?accept="+accept+"&telphone="+telphone+"&province="+province+"&city="+city+"&county="+county+"&detailed="+detailed,
		type:"get",
		success:function(data){
			if(data==1){
				alert("添加地址成功");
				window.location.href = "addaddress.html";
				
			}else {
				alert("服务器繁忙");
			}
		}
	})
	
}
</script>
</body>
</html>